import React, {PureComponent} from 'react';
import {
	StyleSheet,
	View,
	Image,
	TouchableOpacity
} from 'react-native';
import InnerView from '../more/InnerView';

// 获取JSON数据
const MiddleData = require('./MiddleData.json');

/**
 * @FileName: MineMiddleView
 * @Author: mazaiting
 * @Date: 2018/6/14
 * @Description:
 */
class MineMiddleView extends PureComponent {
	render() {
		return (
			<View style={styles.container}>
				{this.renderAllItem()}
			</View>
		)
	}
	
	/**
	 * 渲染所有条目
	 */
	renderAllItem() {
		// 定义数组
		let itemArr = [];
		for (let i = 0; i < MiddleData.length; i++ ){
			let data = MiddleData[i];
			itemArr.push(
				<InnerView key={i} iconName={data.iconName} title={data.title}/>
			)
		}
		return itemArr
	}
}

/**
 * 样式属性
 */
const styles = StyleSheet.create({
	container: {
		paddingLeft: 40,
		paddingRight: 40,
		flexDirection: 'row',
		justifyContent: 'space-between',
		alignItems: 'center',
		backgroundColor: 'rgba(255,0,0,0.5)'
	}
});

/**
 * 导出当前Module
 */
module.exports = MineMiddleView;